﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using QuanLyBongDa.HeThongXuLy;
using QuanLyBongDa.HeThongLuuTru;

namespace QuanLyBongDa.HeThongGiaoDien
{
    public partial class FormDangNhap : Form
    {
        public FormDangNhap()
        {
            InitializeComponent();
        }
        private void btnDangNhap_Click_1(object sender, EventArgs e)
        {
            NguoiDungDTO nd = new NguoiDungDTO();
            nd.TenNguoiDung = txtNguoiDung.Text;
            nd.MatKhau = txtMatKhau.Text;
            nd.PhanQuyen = txtPhanQuyen.Text;
            bool isLogin = NguoiDung.KiemTraNguoiDung(nd);
            if (isLogin == true)
            {
                this.Hide();
                Form1 frm = new Form1();
                frm.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Bạn nhập sai Tên Người Dùng và Mật Khẩu!", "Sai Thông Tin");
            }
        }

        private void txtNguoiDung_TextChanged(object sender, EventArgs e)
        {

        }

        private void txtMatKhau_TextChanged(object sender, EventArgs e)
        {

        }

        private void txtPhanQuyen_TextChanged(object sender, EventArgs e)
        {

        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        
    }
}
